1. Field of the Invention
The present invention relates to a method of binary coding multi-valued image data and also to an apparatus for the same.
2. Description of the Related Art
An error diffusion method has widely been used for binary coding multi-valued image data, in order to record multi-tone images in a simulating manner with a binary recording device, such as an ink jet printer.
FIG. 57 is a block diagram illustrating a conventional image data binary device for which the error diffusion method is applied. Referring to FIG. 57, the image data binary device includes an error memory 120, an adder 122, a comparator 124, a subtracter 126, a bit converter 128, and an error distribution circuit 130.
Multi-valued image data has a dynamic range of 0 to 255. In the drawing of FIG. 57, the thick lines represent multi-bit data lines including symbol bit, integral bits, and decimal bits.
The error diffusion method distributes an error, which arises as a difference between image data for a specific pixel before and after binary coding, into pixels in the vicinity of the specific pixel at a predetermined ratio. FIGS. 58(a) and 58(b) show the principle of the error diffusion method. In the drawing of FIG. 58(a), the procedure of binary coding pixels 232 included in an image 230 is carried out in an order specified by an arrow 231.
In order to binary code multi-valued image data regarding a target pixel P of binary coding (hereinafter referred to as pixel of interest), the multi-valued image data is first corrected by adding error data accumulated for the pixel of interest P to the multi-valued image data. When X denotes a value of multi-valued image data regarding the pixel of interest P and .SIGMA.e.sub.P represents error data accumulated for the pixel of interest P, a value X' of corrected multi-valued image data is given as: EQU X'=X+.SIGMA.e.sub.P ( 1)
The error data accumulated for the pixel of interest P represents the total of errors distributed to the pixel of interest P from the peripheral pixels that have already undergone the binary coding as discussed later.
The value X' of corrected multi-valued image data is then compared with a predetermined threshold value (for example, 128), so that the multi-valued image data regarding the pixel of interest P is binary coded. When Y (0 or 255) represents a value of binary-coded image data, an error `e` arising by binary coding the multi-valued image data for the pixel of interest P is expressed as: EQU e=X'-Y (2)
The value of the error `e` is subsequently distributed at a predetermined ratio (ratio of error distribution) into pixels that are located in the vicinity of the pixel of interest P and have not yet undergone the binary coding. As an example of the conventional error diffusion method, the value of the error `e` is distributed into four pixels in the vicinity of the pixel of interest P; that is, pixels A, B, C, and D located on the immediate right of, on the lower right of, immediately below, and on the lower left of the pixel of interest P as shown in FIG. 58(b). The ratio of error distribution applied is 7/16 to the pixel A, 1/16 to the pixel B, 5/16 to the pixel C, and 3/16 to the pixel D as shown below: EQU Pixel A: e.sub.A =e.times.7/16 EQU Pixel B: e.sub.B =e.times.1/16 EQU Pixel C: e.sub.C =e.times.5/16 EQU Pixel D: e.sub.D =e.times.3/16 (3)
The error distributed into the pixels prior to the binary coding is accumulated as the error data for each pixel in the error memory 120.
The following describes the structure of the image data binary device shown in FIG. 57. The adder 122 receives multi-valued image data regarding the pixel of interest P. The error data .SIGMA.e.sub.P accumulated for the pixel of interest P is read from the error memory 120 and inputted into the adder 122. The adder 122 adds the error data to the input multi-valued image data to correct the multi-valued image data.
The comparator 124 receives the corrected multi-valued image data from the adder 122, compares the corrected multi-valued image data with a separately input reference value, and outputs one-bit data or binary image data based on the results of comparison. This process binary codes the corrected multi-valued image data sent from the adder 122. The bit converter 128 converts the one-bit binary image data outputted from the comparator 124 to 8-bit binary image data (0 or 255).
The subtracter 126 receives the corrected multi-valued image data (image data before the binary coding) outputted from the adder 122 and the image data (image data after the binary coding) outputted from the bit converter 128, subtracts the image data after the binary coding from the image data before the binary coding, and calculates the error `e` arising in the process of binary coding the multi-valued image data for the pixel of interest P.
The error distribution circuit 130 distributes the error `e` obtained by the subtracter 126 into the pixels A, B, C, and D, which are located in the vicinity of the pixel of interest P and have not yet undergone the binary coding, at a predetermined distribution ratio as discussed above with the drawing of FIG. 58. In accordance with a concrete procedure, the error distribution circuit 130 multiplies the error `e` by predetermined coefficients corresponding to the pixels A, B, C, and D, for example, those shown in Equations (3) given above, and adds the results of operations e.sub.A, e.sub.B, e.sub.C, and e.sub.D to error data .SIGMA.e.sub.A, .SIGMA.e.sub.B, .SIGMA.e.sub.C, and .SIGMA.e.sub.D for the pixels A, B, C, and D accumulated in the error memory 120, so as to update the values of the respective error data .SIGMA.e.sub.A, .SIGMA.e.sub.B, .SIGMA.e.sub.C, and .SIGMA.e.sub.D.
The image data binary device shown in FIG. 57 utilizes the error diffusion method to binary code the multi-valued image data. This allows the image to be expressed in quasi multi-tones even when the multi-valued image data has been binary coded.
In the conventional image data binary device, when the input multi-valued image data has a relatively low tone value, the pixels having the value `1` as the binary-coded image data are arranged as dotted lines in the image. When the input multi-valued image data has a relatively high tone value, on the other hand, the pixels having the value `0` as the binary-coded image data are arranged as dotted lines in the image. These dotted lines significantly deteriorate the quality of picture.
When the image data binary device shown in FIG. 57 is applied, for example, to a printer, the tone value of the multi-valued image data corresponds to the density in the resulting recorder image. This means that the input of the multi-valued image data having a relatively low tone value gives a printed image of a relatively low density, whereas the input of the multi-valued image data having a relatively high tone value gives a printed image of a relatively high density.
FIGS. 59, 60, 61, and 62 show the printing results with a printer when the image data binary device of FIG. 57 is applied. FIG. 59 shows the printing result for a low-density area of 0% to 10%; FIG. 60 shows the printing result for a high-density area of 90% to 100%; FIG. 61 shows the printing result for a low-density area of 0% to 15%; and FIG. 62 shows the printing result for a high-density area of 85% to 100%. In these drawings, the density continuously varies in the respective ranges along the width of the image.
The binary coding process in these examples is carried out in the manner shown in FIG. 58(a); that is, starting from the upper left corner of the image and scanning from the left to the right one line by one line. This is also applied to the binary coding process in the examples below.
FIG. 63 shows the printing result specifically selected for the density of 3% among the low-density area of FIG. 59; FIG. 64 shows the printing result specifically selected for the density of 97% among the high-density area of FIG. 60; FIG. 65 shows the printing result specifically selected for the density of 1% among the low-density area of FIG. 59; and FIG. 66 shows the printing result specifically selected for the density of 99% among the high-density area of FIG. 60. In these drawings, the whole image has a homogeneous density.
As shown in FIGS. 59, 61, 63, and 65, black dots (that is, the pixels having the value `1`) are partially arranged as dotted lines running from the upper right to the lower left in the relatively low-density area of 0% to 5%. In a similar manner, as shown in FIGS. 60, 62, 64, and 66, white dots (that is, the pixels having the value `0`) are partially arranged as dotted lines running from the upper right to the lower left in the relatively high-density area of 95% to 100%. In either cases, the black dots or the white dots are not homogeneously dispersed and such dotted lines remarkably deteriorate the quality of picture.
FIG. 67 shows the printing result with a printer for the whole density range of 0% to 100% when the image data binary device of FIG. 57 is applied. In the drawing of FIG. 67, the density continuously varies from the left to the right in the range of 0% to 100% along the width of the image. FIG. 68 shows the printing result with a printer for an intermediate-density range of 15% to 85% when the image data binary device of FIG. 57 is applied. In the drawing of FIG. 68, the density continuously varies in the above range along the width of the image.
In the conventional image data binary device discussed above, when the input image data has an intermediate tone value, textures are often observed in the intermediate-density area of 15% to 85% in the image obtained as the binary-coded image data as shown in FIGS. 67 and 68, thereby deteriorating the quality of picture. The textures herein denote patterns having some regularity and included in a planar distribution of depth.
As disclosed in the paper `Output Image Characteristics by Modified Error Diffusion (MED) method`, pp443-449, Bulletin of Image Electronics Society of Japan, Vol. 20, No. 5 (1991), the proposed method to prevent textures in the intermediate-density area adds dither data to the input image data prior to binary coding and varies the ratio of error distribution for distributing the value of the error `e` at random according to random numbers.
The known technique disclosed in the above paper depresses the occurrence of textures irrespective of the tone value of the input image data prior to binary coding. The processing is thus carried out even for the image data having a relatively low tone value or a relatively high tone value, wherein no significant textures are originally generated. This significantly deteriorates the quality of picture in the low-density area and in the high-density area.
Another proposed method removes the textures observed in the intermediate-density area by adding a random number to a reference value used in the binary-coding means. This method, however, can not remove the textures observed in the low-density area or the high-density area.
The textures observed in the low-density area or the high-density area can be improved by distributing the error, which arises in the process of binary coding the multi-valued image data for the pixel of interest, into a larger number of pixels which have not yet undergone the binary coding. This method, however, undesirably increases the scale of the hardware and lengthens the required processing time for binary coding.